import { Ajax } from '../utils/http';


export class WatchMarketService {
    public async send(): Promise<WatchMarket> {
        var response: WatchMarket;
        var data = {
        }
        try {
            response = await new Ajax<WatchMarket>('/oliview_market', data, true).get();
        } catch (e) {
            throw e;
        }
        return response;
    }
}


export class WatchListService {
    public async send(): Promise<WatchSymbolData> {
        var response: WatchSymbolData;
        var data = {
        }
        try {
            response = await new Ajax<WatchSymbolData>('/new_watchlist_inc_name', data, true).get();
        } catch (e) {
            throw e;
        }
        return response;
    }
}
/*Symbol_and_name*/
export interface StockSymbol {
    symbol: string;
    name: string;
}

/*tsModel1*/
export interface WatchSymbolData {
    symbol_and_name: StockSymbol[];
}



export interface Strategies {
    strategy_name: string;
    begin_date: string;
    end_date: string;
    strategy_results: Array<any>
}

export interface StrategyLine {
    strategy_name: string;
    strategies: Array<Strategies>;
}

export enum StatisticType {
    incomes = 0,
    assets = 1,
    cashFlows = 2
}



/*Strategy_results*/
export interface Strategy_results {
    t_stats_volume: string;
    t_stats_avg_price: string;
    price_date_correlation: string;
  }
  
  /*Abnormal_trading_volumn*/
  export interface Abnormal_trading_volumn {
    symbol_id: string;
    symbol_name: string;
    begin_date: string;
    end_date: string;
    strategy_results: Strategy_results;
  }
  
  /*Top_10*/
  export interface Movements {
    symbol_id: string;
    symbol_name: string;
    price: number;
    daily_return: number;
  }

  /*Top_movements*/
  export interface Top_movements {
    date: string;
    top_10: Movements[];
    last_10: Movements[];
  }
  
  /*tsModel5*/
  export interface WatchMarket {
    abnormal_trading_volumn: Abnormal_trading_volumn[];
    top_movements: Top_movements;
  }
  
  